package luj.game.robot.api.network.http;

import java.util.List;
import luj.game.robot.api.action.CommandService;
import luj.game.robot.api.action.RobotBossCommand;
import luj.game.robot.api.action.RobotDataCommand;

public interface RobotHttpHandler {

  interface Context {

    Http http();

    <P> P param();

    Service service();
  }

  interface Http {

    Param param(String name);
  }

  interface Param {

    String name();

    boolean exists();

    String asStr();

    int asInt();

    long asLong();

    double asDouble();

    <T> List<T> asList(Class<T> type);
  }

  interface Service {

    Boss boss();
  }

  interface Boss {

    <P> CommandService<P> command(Class<? extends RobotBossCommand<P>> cmdType);
  }

  void onHandle(Context ctx);
}
